﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using BookSystem.CommomHelper;
using BookSystem.Model;

namespace BookSystem.User
{
    public partial class UserUpdatePwd : Form
    {
        public UserUpdatePwd()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            model.User u = new model.User();
            u.Uid = Main.id;
            if (pwd1.Text == pwd2.Text)
            {
                u.Pwd = pwd1.Text;
            }
            else {

                MessageBox.Show("新密码确认错误，请重新确认输入");
                return;
            
            }

            if (BLL.User.updatePwd(u))
            {

                MessageBox.Show("更改成功！");

            }
            else {

                MessageBox.Show("更改失败！");
            
            }
            

        }
    }
}
